<template>
  <div>
    <van-nav-bar title="我的收藏" left-arrow @click-left="onClickLeft" />
    <!-- <div class="none" v-if="postList.length ===0 ">
      赶紧去收藏吧
    </div> -->
    <Article  v-for="item in postList" :key="item.id" :postData="item" />
  </div>
</template>
<script>
import Article from '../components/Article'
export default {
  data(){
    return {
      postList:[]
    }
  },
  created() {
    this.getPostList()
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1)
    },
    async getPostList(){
      const {data:res}  = await this.$http.get('/user_star')
      this.postList = res.data
      console.log(this.postList)
    }
  },
  components:{
    Article
  }
}
</script>
<style lang="less" scoped>
.none{
  text-align: center;
  margin: 5.556vw 0 ;
  color:#e4e4e4;
 }
</style>